package net.bxx2004.extand.manager;

import net.bxx2004.extand.extand;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;

import java.io.File;
import java.util.Iterator;

public class ConfigManager {
    private static Plugin plugin = extand.getPlugin(extand.class);
    private static FileConfiguration setting;
    public void setUp(){
        plugin.saveDefaultConfig();
        Register();
    }
    private void Register(){
        System.out.println("开始注册配置文件...");
        plugin.saveResource("setting.yml", false);
        File settings =  new File("plugins/Extand/setting.yml");
        setting = YamlConfiguration.loadConfiguration(settings);
    }
    public static FileConfiguration getConfig(){
        return plugin.getConfig();
    }
    public static FileConfiguration getSetting(){
        return setting;
    }
    public static Plugin getPlugin(){
        return plugin;
    }
}
